using System;
using System.Collections.Generic;
using System.Text;

namespace WowGuildSite.Armory
{
    public class ArmoryMeleeStats
    {
        private ArmoryCharacter character;

        public ArmoryCombatStat MainHand
        {
            get
            {
                return ArmoryCombatStat.FromElement(    character.SheetDocument.GetElement("/page/characterInfo/characterTab/melee/mainHandDamage"),
                                                        character.SheetDocument.GetElement("/page/characterInfo/characterTab/melee/mainHandWeaponSkill"));
            }
        }

        public ArmoryCombatStat OffHand
        {
            get
            {
                return ArmoryCombatStat.FromElement(    character.SheetDocument.GetElement("/page/characterInfo/characterTab/melee/offHandDamage"),
                                                        character.SheetDocument.GetElement("/page/characterInfo/characterTab/melee/offHandWeaponSkill"));
            }
        }

        public int              HitRating
        {
            get
            {
                return character.SheetDocument.GetAttributeInt("/page/characterInfo/characterTab/melee/hitRating/@value");
            }
        }

        public decimal          CritChance
        {
            get
            {
                return character.SheetDocument.GetAttributeDecimal("/page/characterInfo/characterTab/melee/critChance/@percent");
            }
        }

        public int              PowerBase
        {
            get
            {
                return character.SheetDocument.GetAttributeInt("/page/characterInfo/characterTab/melee/power/@base");
            }
        }

        public int              PowerEffective
        {
            get
            {
                return character.SheetDocument.GetAttributeInt("/page/characterInfo/characterTab/melee/power/@effective");
            }
        }

        internal ArmoryMeleeStats( ArmoryCharacter character )
        {
            if (character == null)
            {
                throw new ArgumentNullException("character");
            }

            this.character = character;
        }
    }
}
